import wepy from 'wepy'
import { wxRequest } from '../lib/wxRequest'


// const apiMall = 'http://39.106.76.244:80'
const apiMall = 'https://dakaoyan.cosmolove.cn'

/**
 * 登陆注册
 * @param {*} parms
 */
export const getRegister = parms =>
  wxRequest(parms, apiMall + '/signin/registOrlogin')

/**
 * 获取用户信息
 * @param {*} parms
 */
export const getUserInfo = parms =>
  wxRequest(parms, apiMall + '/user/userInfo')

/**
 * 答题记录
 * @param {*} parms
 */
export const getAnswersData = parms =>
  wxRequest(parms, apiMall + '/user/getAnswersData')

/**
 * 我的答题列表
 * @param {*} parms
 */
export const getCurrUserAnswersData = parms =>
  wxRequest(parms, apiMall + '/user/getCurrUserAnswersData')

/**
 * 设置题目
 * @param {*} parms
 */
export const getQuestionList = parms =>
  wxRequest(parms, apiMall + '/questions/list')

/**
 * 保存出题接口
 * @param {*} parms
 */
export const saveQuestion = parms =>
  wxRequest(parms, apiMall + '/questions/save')

/**
 * 答题时拉取题目列表
 * @param {*} parms
 */
export const AnswerQuestionList = parms =>
  wxRequest(parms, apiMall + '/answer/question/list')

/**
 * 提交答案
 * @param {*} parms
 */
export const AnswerSubmit = parms =>
  wxRequest(parms, apiMall + '/answer/submit')

/**
 * 我的出题
 * @param {*} parms
 */
export const userAnswer = parms =>
  wxRequest(parms, apiMall + '/user/myAnswer')

/**
 * 正确答案
 * @param {*} parms
 */
export const mySettingQuestions = parms =>
  wxRequest(parms, apiMall + '/user/mySettingQuestions')
/**
 * 分享
 * @param {*} parms
 */
export const shareQuestion = parms =>
  wxRequest(parms, apiMall + '/questions/share')

/**
 * 排行榜
 * @param {*} parms
 */
export const scoreRankingList = parms =>
  wxRequest(parms, apiMall + '/answer/scoreRankingList')
/**
 * 获取我的id
 * @param {*} parms
 */
export const getUserAnswerSettingId = parms =>
  wxRequest(parms, apiMall + '/user/getUserAnswerSettingId')
/**
 * 获取手机号
 * @param {*} parms
 */
export const settingMobile = parms =>
  wxRequest(parms, apiMall + '/user/settingMobile')
/**
 * 判断是否答题
 * @param {*} parms
 */
export const answerStatus = parms =>
  wxRequest(parms, apiMall + '/user/answerStatus')
/**
 * formid
 * @param {*} parms
 */
export const saveFormId = parms =>
  wxRequest(parms, apiMall + '/user/saveFormId')
